package com.administrator.customviewtest.other_test.act_launch_mode;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;

import com.administrator.customviewtest.R;
import com.administrator.customviewtest.view.test.ScrollChooseView;


/**
 * Created by Administrator on 2016/10/15.
 */

public class Activty1 extends Activity {
    private static final String TAG = "Activty1";
    private ScrollChooseView scrollChooseView;
    String titles[] = new String[]{"早餐前", "早餐后", "午餐前", "午餐后", "晚餐前", "晚餐后", "睡前"};
    private int picIds[] = new int[]{
            R.mipmap.time_bg_breakfastbefore, R.mipmap.time_bg_breakfastafter,
            R.mipmap.time_bg_lunchbefore, R.mipmap.time_bg_lunchafter,
            R.mipmap.time_bg_dinnerbefor, R.mipmap.time_bg_dinnerafter,
            R.mipmap.time_bg_sleep
    };

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.test);

        scrollChooseView = (ScrollChooseView) findViewById(R.id.id_test16);

        scrollChooseView.setTitles(titles);

        scrollChooseView.setPicIds(picIds);

        scrollChooseView.setOnScrollEndListener(new ScrollChooseView.OnScrollEndListener() {
            @Override
            public void currentPosition(int position) {
                Log.d(TAG, "当前positin=" + position + " " + titles[position]);
            }
        });
    }

    @Override
    protected void onNewIntent(Intent intent) {
        Log.e("ssss", "1  intent");
        super.onNewIntent(intent);
    }
}
